#include <iostream>
#include <cstring>
using namespace std;
const int N = 15;
int tt[N], d[N], l[N];
int n, T;
bool st[N];
bool have_ans = false;
void dfs(int x, int all_time)
{
    if(have_ans) return;
    if(x == n)
    {
        have_ans = true;
        return;
    }
    for(int i = 0; i < n; ++i)
        if(!st[i])
        {
            int next_time;
            // 尝试降落
            if(all_time < tt[i])
                next_time = tt[i] + l[i];
            else if(all_time <= tt[i] + d[i])
                next_time = all_time + l[i];
            //降落失败
            else continue;
            // 成功降落，标记已经飞入
            st[i] = true;
            dfs(x + 1, next_time);
            // 恢复原状
            st[i] = false;
        }
}


int main()
{
    cin >> T;
    for(int i = 0; i < T; ++i)
    {
        //每次初始化没有飞机来过
        memset(st, 0, sizeof st);
        //初始化没有答案
        have_ans = false;
        cin >> n;
        for(int i = 0; i < n; ++i)
            cin >> tt[i] >> d[i] >> l[i];
        dfs(0, 0);
        if(have_ans) cout << "YES\n";
        else cout << "NO\n";
    }
    return 0;
}